home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mlib / include / mgraph.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-26  |  3.8 KB  |  118 lines

  1.  
  2. #ifndef __MGRAPH_H
  3. #define __MGRAPH_H
  4.  
  5. #include <math.h>
  6. #include <mfonts.h>
  7. #include <maplane.h>
  8. #include <mpal.h>
  9.  
  10. #define MAXX            320
  11. #define MAXY            200
  12. #define MASK_MAXX        40
  13.  
  14. #define EMPTY_FILL        0
  15. #define SOLID_FILL        1
  16. #define PATTERN_FILL      2
  17.  
  18. #define PATTERN_SIDE      5
  19. #define PATTERN_SIZE     25
  20.  
  21. #define SCREEN_ADDRESS   (char far*)(0xA0000000L)
  22. #define SCREEN_SIZE                  0xFA00
  23. #define MASK_SIZE                    (SCREEN_SIZE / BITSPERBYTE)
  24.  
  25. #define MGRAPH_ID         0x010D
  26.  
  27. /////////////////////// PROTOTYPES ///////////////////////////////////////////
  28.  
  29.  void            bar (int left,int top,int right,int bottom);
  30.  void            bar (const RECT& area);
  31.  void            circle (int xpos,int ypos,unsigned int radius);
  32.  void            fillcircle (int xpos,int ypos,unsigned int radius);
  33.  void            cleardevice (void);
  34.  void            clearviewport (void);
  35.  BOOL            clipscreen (int *x, int *y);
  36.  void            clipscreen (RECT *area);
  37.  void            clipscreen (VP *area);
  38.  void            setdpy (ADR address, WORD length, WORD width);
  39.  void            setviewport (int left,int top,int right,int bottom);
  40.  void            setviewport (const RECT& AView);
  41.  void            moveto (int x,int y);
  42.  int             outtextxy (int x,int y,char *string);
  43.  void            drawpoly (WORD nPoints, POINT * polypoints);
  44.  void            swap_fill_draw (void);
  45.  void            setcolor (WORD new_color);
  46.  int             getminx (void);
  47.  int             getminy (void);
  48.  int             getmaxx (void);
  49.  int             getmaxy (void);
  50.  void            push_DC (void);
  51.  void            pop_DC (void);
  52.  void            setfillstyle (int new_fill,int new_fill_color);
  53.  void            initgraph (void);
  54.  BOOL            IsInside (const RECT& area, int x, int y);
  55.  void            closegraph (void);
  56.  int             getcolor (void);
  57.  int             getpixel (int x,int y);
  58.  void            get_rect_back (int left, int top, int right,
  59.                 int bottom, BYTE *image);
  60.  void            hor_line (int from,int to,int level);
  61.  void            lineto (int to_x, int to_y);
  62.  void            linerel (int dx, int dy);
  63.  void            line (int left,int top,int right,int bottom);
  64.  void            putpixel (int x,int y);
  65.  void            put_rect_back (int left, int top, int right,
  66.                 int bottom, BYTE *image);
  67.  void            floodfill (int x,int y);
  68.  void            rectangle (int left,int top,int right,int bottom);
  69.  void            rectangle (const RECT& area);
  70.  void            vert_line (int from,int to,int level);
  71. //////////////////////////////////////////////////////////////////////////////
  72.  
  73. class Display : virtual public MObject {
  74. public:
  75.     ADR            address;
  76.     WORD           length;
  77.     WORD           width;
  78. public:
  79.     Display&       operator= (const Display& dpy);
  80. };
  81.  
  82. class DC : public MObject{
  83. public:
  84.     VP             vp;
  85.     WORD           color;
  86.     WORD           fill_color;
  87.     Display        dpy;
  88. };
  89.  
  90. //////////////////////////////////////////////////////////////////////////////
  91.  
  92. class MGraph : public MObject{
  93. public:
  94.     int                     xpos;
  95.     int                     ypos;
  96.     VP                      vp;
  97.     FONT                    font;
  98.     APLANE *                aplane;
  99.     WORD                    color;
  100.     WORD                    fill_color;
  101.     MPal                    palette;
  102.     BOOL                    IsGraphics;
  103.     WORD                    scr_size;
  104.     Display                 dpy;
  105.  
  106. public:
  107.                  MGraph (void);
  108.     virtual inline classType isA (void) {return (MGRAPH_ID);};
  109.                 ~MGraph (void);
  110. };
  111. #define GRAPH                MGraph
  112.  
  113. #ifndef GRAPH_UNIT
  114. extern MGraph gr;
  115. extern BYTE bits[];
  116. #endif
  117. #endif
  118.